package com.geekhome.znxz.cucumber.chapter1;

import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import io.cucumber.datatable.DataTable;

import java.util.List;

/**
 * Copyright © 2019年 znxz. All rights reserved.
 *
 * @author 临江仙 hzqiuxm@163.com
 * 复杂数据测试
 * @date 2019/5/23 10:01
 */
public class ComplexStepdefs {
    @Given("^the user account infomation$")
    public void theUserAccountInfomation() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        System.out.println("the user account infomation");
    }

    @Then("^we can found user \"([^\"]*)\", with password \"([^\"]*)\", phone \"([^\"]*)\"$")
    public void weCanFoundUserWithPasswordPhone(String name, String password, String phone) throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        System.out.println(name);
        System.out.println(password);
        System.out.println(phone);
    }

    @Given("^use complex data$")
    public void useComplexData() throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        System.out.println("use complex data");
    }

    @Then("^验证下面的一些用户账号信息$")
    public void 验证下面的一些用户账号信息(DataTable dataTable) throws Throwable {
        // Write code here that turns the phrase above into concrete actions
        List<List<String>> lists = dataTable.asLists();
        lists.forEach(System.out::println);
    }
}
